// https://leetcode.cn/problems/reverse-bits/
// Created by ade on 2022/7/25.
// 颠倒给定的 32 位无符号整数的二进制位。

class Solution {
public:
    uint32_t reverseBits(uint32_t n) {
        uint32_t ans = 0;
        int i = 32;
        while(i--){
            ans <<= 1;
            ans += n&1;
            n>>=1;
        }
        return ans;
    }
};


